package com.chapter1;

/**
 * substring 字符串截取Test
 */
public class SubstringTest {

    public static void main(String[] args) {
        //		String currentURL = "111/index/bhu";
        String currentURL = "111/static/bhu"; //3
//		String currentURL = "/static/bhu"; // 0
//		String currentURL = "/statc/bhu"; // 0

        System.out.println(currentURL.indexOf("/static/"));
        System.out.println(currentURL.indexOf("/static/"));

        System.out.println(currentURL.substring(currentURL.indexOf("/")));
        String targetURL = currentURL.substring(currentURL.indexOf("/"), currentURL.length());
        System.out.println(targetURL);
    }

}
